Optimal. Leaf size=229 \[ -\frac {B g x (b c-a d) \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (c^2 g^2-4 c d f g+6 d^2 f^2\right )\right )}{2 b^3 d^3}+\frac {(f+g x)^4 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{4 g}-\frac {B (b f-a g)^4 \log (a+b x)}{2 b^4 g}-\frac {B g^2 x^2 (b c-a d) (-a d g-b c g+4 b d f)}{4 b^2 d^2}-\frac {B g^3 x^3 (b c-a d)}{6 b d}+\frac {B (d f-c g)^4 \log (c+d x)}{2 d^4 g} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.32, antiderivative size = 229, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {2525, 12, 72} \[ -\frac {B g x (b c-a d) \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (c^2 g^2-4 c d f g+6 d^2 f^2\right )\right )}{2 b^3 d^3}+\frac {(f+g x)^4 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{4 g}-\frac {B g^2 x^2 (b c-a d) (-a d g-b c g+4 b d f)}{4 b^2 d^2}-\frac {B (b f-a g)^4 \log (a+b x)}{2 b^4 g}-\frac {B g^3 x^3 (b c-a d)}{6 b d}+\frac {B (d f-c g)^4 \log (c+d x)}{2 d^4 g} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 72
Rule 2525
Rubi steps
\begin {align*} \int (f+g x)^3 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx &=\frac {(f+g x)^4 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{4 g}-\frac {B \int \frac {2 (b c-a d) (f+g x)^4}{(a+b x) (c+d x)} \, dx}{4 g}\\ &=\frac {(f+g x)^4 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{4 g}-\frac {(B (b c-a d)) \int \frac {(f+g x)^4}{(a+b x) (c+d x)} \, dx}{2 g}\\ &=\frac {(f+g x)^4 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{4 g}-\frac {(B (b c-a d)) \int \left (\frac {g^2 \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right )}{b^3 d^3}+\frac {g^3 (4 b d f-b c g-a d g) x}{b^2 d^2}+\frac {g^4 x^2}{b d}+\frac {(b f-a g)^4}{b^3 (b c-a d) (a+b x)}+\frac {(d f-c g)^4}{d^3 (-b c+a d) (c+d x)}\right ) \, dx}{2 g}\\ &=-\frac {B (b c-a d) g \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right ) x}{2 b^3 d^3}-\frac {B (b c-a d) g^2 (4 b d f-b c g-a d g) x^2}{4 b^2 d^2}-\frac {B (b c-a d) g^3 x^3}{6 b d}-\frac {B (b f-a g)^4 \log (a+b x)}{2 b^4 g}+\frac {(f+g x)^4 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{4 g}+\frac {B (d f-c g)^4 \log (c+d x)}{2 d^4 g}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.26, size = 217, normalized size = 0.95 \[ \frac {(f+g x)^4 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )-\frac {B \left (6 b d g^2 x (b c-a d) \left (a^2 d^2 g^2+a b d g (c g-4 d f)+b^2 \left (c^2 g^2-4 c d f g+6 d^2 f^2\right )\right )+2 b^3 d^3 g^4 x^3 (b c-a d)+3 b^2 d^2 g^3 x^2 (b c-a d) (-a d g-b c g+4 b d f)+6 d^4 (b f-a g)^4 \log (a+b x)-6 b^4 (d f-c g)^4 \log (c+d x)\right )}{3 b^4 d^4}}{4 g} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.31, size = 468, normalized size = 2.04 \[ \frac {3 \, A b^{4} d^{4} g^{3} x^{4} + 2 \, {\left (6 \, A b^{4} d^{4} f g^{2} - {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} g^{3}\right )} x^{3} + 3 \, {\left (6 \, A b^{4} d^{4} f^{2} g - 4 \, {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} f g^{2} + {\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} g^{3}\right )} x^{2} + 6 \, {\left (2 \, A b^{4} d^{4} f^{3} - 6 \, {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} f^{2} g + 4 \, {\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} f g^{2} - {\left (B b^{4} c^{3} d - B a^{3} b d^{4}\right )} g^{3}\right )} x + 6 \, {\left (4 \, B a b^{3} d^{4} f^{3} - 6 \, B a^{2} b^{2} d^{4} f^{2} g + 4 \, B a^{3} b d^{4} f g^{2} - B a^{4} d^{4} g^{3}\right )} \log \left (b x + a\right ) - 6 \, {\left (4 \, B b^{4} c d^{3} f^{3} - 6 \, B b^{4} c^{2} d^{2} f^{2} g + 4 \, B b^{4} c^{3} d f g^{2} - B b^{4} c^{4} g^{3}\right )} \log \left (d x + c\right ) + 3 \, {\left (B b^{4} d^{4} g^{3} x^{4} + 4 \, B b^{4} d^{4} f g^{2} x^{3} + 6 \, B b^{4} d^{4} f^{2} g x^{2} + 4 \, B b^{4} d^{4} f^{3} x\right )} \log \left (\frac {b^{2} e x^{2} + 2 \, a b e x + a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{12 \, b^{4} d^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 167.45, size = 447, normalized size = 1.95 \[ \frac {1}{4} \, {\left (A g^{3} + B g^{3}\right )} x^{4} + \frac {{\left (6 \, A b d f g^{2} + 6 \, B b d f g^{2} - B b c g^{3} + B a d g^{3}\right )} x^{3}}{6 \, b d} + \frac {1}{4} \, {\left (B g^{3} x^{4} + 4 \, B f g^{2} x^{3} + 6 \, B f^{2} g x^{2} + 4 \, B f^{3} x\right )} \log \left (\frac {b^{2} x^{2} + 2 \, a b x + a^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {{\left (6 \, A b^{2} d^{2} f^{2} g + 6 \, B b^{2} d^{2} f^{2} g - 4 \, B b^{2} c d f g^{2} + 4 \, B a b d^{2} f g^{2} + B b^{2} c^{2} g^{3} - B a^{2} d^{2} g^{3}\right )} x^{2}}{4 \, b^{2} d^{2}} + \frac {{\left (4 \, B a b^{3} f^{3} - 6 \, B a^{2} b^{2} f^{2} g + 4 \, B a^{3} b f g^{2} - B a^{4} g^{3}\right )} \log \left (b x + a\right )}{2 \, b^{4}} - \frac {{\left (4 \, B c d^{3} f^{3} - 6 \, B c^{2} d^{2} f^{2} g + 4 \, B c^{3} d f g^{2} - B c^{4} g^{3}\right )} \log \left (-d x - c\right )}{2 \, d^{4}} + \frac {{\left (2 \, A b^{3} d^{3} f^{3} + 2 \, B b^{3} d^{3} f^{3} - 6 \, B b^{3} c d^{2} f^{2} g + 6 \, B a b^{2} d^{3} f^{2} g + 4 \, B b^{3} c^{2} d f g^{2} - 4 \, B a^{2} b d^{3} f g^{2} - B b^{3} c^{3} g^{3} + B a^{3} d^{3} g^{3}\right )} x}{2 \, b^{3} d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.09, size = 1783, normalized size = 7.79 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.06, size = 623, normalized size = 2.72 \[ \frac {1}{4} \, A g^{3} x^{4} + A f g^{2} x^{3} + \frac {3}{2} \, A f^{2} g x^{2} + {\left (x \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {2 \, a \log \left (b x + a\right )}{b} - \frac {2 \, c \log \left (d x + c\right )}{d}\right )} B f^{3} + \frac {3}{2} \, {\left (x^{2} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) - \frac {2 \, a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {2 \, c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {2 \, {\left (b c - a d\right )} x}{b d}\right )} B f^{2} g + {\left (x^{3} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} B f g^{2} + \frac {1}{12} \, {\left (3 \, x^{4} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) - \frac {6 \, a^{4} \log \left (b x + a\right )}{b^{4}} + \frac {6 \, c^{4} \log \left (d x + c\right )}{d^{4}} - \frac {2 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} x^{2} + 6 \, {\left (b^{3} c^{3} - a^{3} d^{3}\right )} x}{b^{3} d^{3}}\right )} B g^{3} + A f^{3} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.03, size = 743, normalized size = 3.24 \[ \ln \left (\frac {e\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2}\right )\,\left (B\,f^3\,x+\frac {3\,B\,f^2\,g\,x^2}{2}+B\,f\,g^2\,x^3+\frac {B\,g^3\,x^4}{4}\right )+x\,\left (\frac {2\,A\,b\,d\,f^3+6\,A\,a\,c\,f\,g^2+6\,A\,a\,d\,f^2\,g+6\,A\,b\,c\,f^2\,g+6\,B\,a\,d\,f^2\,g-6\,B\,b\,c\,f^2\,g}{2\,b\,d}+\frac {\left (2\,a\,d+2\,b\,c\right )\,\left (\frac {\left (\frac {2\,A\,a\,d\,g^3+2\,A\,b\,c\,g^3+B\,a\,d\,g^3-B\,b\,c\,g^3+6\,A\,b\,d\,f\,g^2}{2\,b\,d}-\frac {A\,g^3\,\left (2\,a\,d+2\,b\,c\right )}{2\,b\,d}\right )\,\left (2\,a\,d+2\,b\,c\right )}{2\,b\,d}-\frac {2\,A\,a\,c\,g^3+6\,A\,a\,d\,f\,g^2+6\,A\,b\,c\,f\,g^2+6\,A\,b\,d\,f^2\,g+4\,B\,a\,d\,f\,g^2-4\,B\,b\,c\,f\,g^2}{2\,b\,d}+\frac {A\,a\,c\,g^3}{b\,d}\right )}{2\,b\,d}-\frac {a\,c\,\left (\frac {2\,A\,a\,d\,g^3+2\,A\,b\,c\,g^3+B\,a\,d\,g^3-B\,b\,c\,g^3+6\,A\,b\,d\,f\,g^2}{2\,b\,d}-\frac {A\,g^3\,\left (2\,a\,d+2\,b\,c\right )}{2\,b\,d}\right )}{b\,d}\right )-x^2\,\left (\frac {\left (\frac {2\,A\,a\,d\,g^3+2\,A\,b\,c\,g^3+B\,a\,d\,g^3-B\,b\,c\,g^3+6\,A\,b\,d\,f\,g^2}{2\,b\,d}-\frac {A\,g^3\,\left (2\,a\,d+2\,b\,c\right )}{2\,b\,d}\right )\,\left (2\,a\,d+2\,b\,c\right )}{4\,b\,d}-\frac {2\,A\,a\,c\,g^3+6\,A\,a\,d\,f\,g^2+6\,A\,b\,c\,f\,g^2+6\,A\,b\,d\,f^2\,g+4\,B\,a\,d\,f\,g^2-4\,B\,b\,c\,f\,g^2}{4\,b\,d}+\frac {A\,a\,c\,g^3}{2\,b\,d}\right )+x^3\,\left (\frac {2\,A\,a\,d\,g^3+2\,A\,b\,c\,g^3+B\,a\,d\,g^3-B\,b\,c\,g^3+6\,A\,b\,d\,f\,g^2}{6\,b\,d}-\frac {A\,g^3\,\left (2\,a\,d+2\,b\,c\right )}{6\,b\,d}\right )+\frac {A\,g^3\,x^4}{4}-\frac {\ln \left (a+b\,x\right )\,\left (B\,a^4\,g^3-4\,B\,a^3\,b\,f\,g^2+6\,B\,a^2\,b^2\,f^2\,g-4\,B\,a\,b^3\,f^3\right )}{2\,b^4}+\frac {\ln \left (c+d\,x\right )\,\left (B\,c^4\,g^3-4\,B\,c^3\,d\,f\,g^2+6\,B\,c^2\,d^2\,f^2\,g-4\,B\,c\,d^3\,f^3\right )}{2\,d^4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 12.64, size = 998, normalized size = 4.36 \[ \frac {A g^{3} x^{4}}{4} - \frac {B a \left (a g - 2 b f\right ) \left (a^{2} g^{2} - 2 a b f g + 2 b^{2} f^{2}\right ) \log {\left (x + \frac {B a^{4} c d^{3} g^{3} - 4 B a^{3} b c d^{3} f g^{2} + 6 B a^{2} b^{2} c d^{3} f^{2} g + \frac {B a^{2} d^{4} \left (a g - 2 b f\right ) \left (a^{2} g^{2} - 2 a b f g + 2 b^{2} f^{2}\right )}{b} + B a b^{3} c^{4} g^{3} - 4 B a b^{3} c^{3} d f g^{2} + 6 B a b^{3} c^{2} d^{2} f^{2} g - 8 B a b^{3} c d^{3} f^{3} - B a c d^{3} \left (a g - 2 b f\right ) \left (a^{2} g^{2} - 2 a b f g + 2 b^{2} f^{2}\right )}{B a^{4} d^{4} g^{3} - 4 B a^{3} b d^{4} f g^{2} + 6 B a^{2} b^{2} d^{4} f^{2} g - 4 B a b^{3} d^{4} f^{3} + B b^{4} c^{4} g^{3} - 4 B b^{4} c^{3} d f g^{2} + 6 B b^{4} c^{2} d^{2} f^{2} g - 4 B b^{4} c d^{3} f^{3}} \right )}}{2 b^{4}} + \frac {B c \left (c g - 2 d f\right ) \left (c^{2} g^{2} - 2 c d f g + 2 d^{2} f^{2}\right ) \log {\left (x + \frac {B a^{4} c d^{3} g^{3} - 4 B a^{3} b c d^{3} f g^{2} + 6 B a^{2} b^{2} c d^{3} f^{2} g + B a b^{3} c^{4} g^{3} - 4 B a b^{3} c^{3} d f g^{2} + 6 B a b^{3} c^{2} d^{2} f^{2} g - 8 B a b^{3} c d^{3} f^{3} - B a b^{3} c \left (c g - 2 d f\right ) \left (c^{2} g^{2} - 2 c d f g + 2 d^{2} f^{2}\right ) + \frac {B b^{4} c^{2} \left (c g - 2 d f\right ) \left (c^{2} g^{2} - 2 c d f g + 2 d^{2} f^{2}\right )}{d}}{B a^{4} d^{4} g^{3} - 4 B a^{3} b d^{4} f g^{2} + 6 B a^{2} b^{2} d^{4} f^{2} g - 4 B a b^{3} d^{4} f^{3} + B b^{4} c^{4} g^{3} - 4 B b^{4} c^{3} d f g^{2} + 6 B b^{4} c^{2} d^{2} f^{2} g - 4 B b^{4} c d^{3} f^{3}} \right )}}{2 d^{4}} + x^{3} \left (A f g^{2} + \frac {B a g^{3}}{6 b} - \frac {B c g^{3}}{6 d}\right ) + x^{2} \left (\frac {3 A f^{2} g}{2} - \frac {B a^{2} g^{3}}{4 b^{2}} + \frac {B a f g^{2}}{b} + \frac {B c^{2} g^{3}}{4 d^{2}} - \frac {B c f g^{2}}{d}\right ) + x \left (A f^{3} + \frac {B a^{3} g^{3}}{2 b^{3}} - \frac {2 B a^{2} f g^{2}}{b^{2}} + \frac {3 B a f^{2} g}{b} - \frac {B c^{3} g^{3}}{2 d^{3}} + \frac {2 B c^{2} f g^{2}}{d^{2}} - \frac {3 B c f^{2} g}{d}\right ) + \left (B f^{3} x + \frac {3 B f^{2} g x^{2}}{2} + B f g^{2} x^{3} + \frac {B g^{3} x^{4}}{4}\right ) \log {\left (\frac {e \left (a + b x\right )^{2}}{\left (c + d x\right )^{2}} \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________